<?php
class Sys_config extends CActiveRecord
{
	public static function model($className = __CLASS__)
	{
		return parent::model($className);
	}
	
	public function tableName()
	{
	    return strtolower(get_class($this));
	}
	
	public function getconfig($config)
	{
		//TODO 可以使用缓存优化
		$record = $this->model()->findByPk($config);
		if($record)
		{
			return $record->value;
		}
		return '';
	}
}